home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2000 November / Maximum CD 2000 Nov.iso / AofE-Conquerers / age2xtrial.exe / CABFILE / MSGAME.CAB / Data / gamedata_x1.drs / Unnamed File 000009.bina < prev    next >
Text File  |  2000-07-18  |  26KB  |  1,164 lines

  1. (defrule
  2.     (goal siege-available YES)
  3.     (or
  4.         (or
  5.             (players-building-type-count any-enemy watch-tower-line > 1)
  6.             (players-building-type-count any-enemy castle > 0)
  7.         )
  8.         (or
  9.             (players-building-type-count any-enemy bombard-tower > 0)
  10.             (players-building-type-count any-enemy town-center > 1)
  11.         )
  12.     )
  13. =>
  14.     (set-goal siege-available NO)
  15. )
  16.  
  17. (defrule
  18.     (goal siege-available YES)
  19.     (or
  20.         (players-building-type-count any-enemy stone-wall > 10)
  21.         (players-building-type-count any-enemy fortified-wall > 10)
  22.     )
  23. =>
  24.     (set-goal siege-available NO)
  25. )
  26.  
  27. (defrule
  28.     (goal siege-available NO)
  29.     (or
  30.         (population >= pop-cap)
  31.         (or
  32.             (or
  33.                 (unit-type-count battering-ram-line > 0)
  34.                 (unit-type-count mangonel-line > 0)
  35.             )
  36.             (or
  37.                 (unit-type-count bombard-cannon > 0)
  38.                 (unit-type-count trebuchet > 0)
  39.             )
  40.         )
  41.     )
  42. =>
  43.     (set-goal siege-available YES)
  44. )
  45.  
  46. (defrule
  47.     (goal siege-available NO)
  48.     (goal 1 10)
  49.     (unit-type-count cannon-galleon > 1)
  50. =>
  51.     (set-goal siege-available YES)
  52. )
  53.  
  54. (defrule
  55.     (goal siege-available NO)
  56.     (unit-type-count petard >= ten-percent-pop)
  57. =>
  58.     (set-goal siege-available YES)
  59. )
  60.  
  61. (defrule
  62.     (goal soldiers-available NO)
  63.     (or
  64.         (or
  65.             (unit-type-count militiaman-line > five-percent-pop)
  66.             (unit-type-count knight-line > five-percent-pop)
  67.         )
  68.         (or
  69.             (or
  70.                 (unit-type-count scout-cavalry-line > five-percent-pop)
  71.                 (unit-type-count cavalry-archer-line > five-percent-pop)
  72.             )
  73.             (or
  74.                 (unit-type-count archer-line > five-percent-pop)
  75.                 (unit-type-count my-unique-unit-line > five-percent-pop)
  76.             )
  77.         )
  78.     )
  79. =>
  80.     (set-goal soldiers-available YES)
  81. )
  82.  
  83. (defrule
  84.     (goal soldiers-available YES)
  85.     (unit-type-count militiaman-line < five-percent-pop)
  86.     (unit-type-count knight-line < five-percent-pop)
  87.     (unit-type-count scout-cavalry-line < five-percent-pop)
  88.     (unit-type-count cavalry-archer-line < five-percent-pop)
  89.     (unit-type-count archer-line < five-percent-pop)
  90.     (unit-type-count my-unique-unit-line < five-percent-pop)
  91. =>
  92.     (set-goal soldiers-available NO)
  93. )
  94.  
  95. ;*****************************************
  96. ;PETARD
  97. (defrule
  98.     (goal siege-available NO)
  99.     (or
  100.         (or
  101.             (building-type-count siege-workshop == 0)
  102.             (building-type-count castle == 0)
  103.         )
  104.         (or
  105.             (wood-amount < 160)
  106.             (gold-amount < 75)
  107.         )
  108.     )
  109.     (can-train petard)
  110. =>
  111.     (train petard)
  112. )
  113.  
  114. ;*****************************************
  115. ;MANGONEL/ONAGER
  116.  
  117. (defrule
  118.     (goal siege-available NO)
  119.     (can-train-with-escrow mangonel-line)
  120.     (nor
  121.         (can-train mangonel-line)
  122.         (goal upgrade-conflict NOTICE)
  123.     )
  124. =>
  125.     (release-escrow wood)
  126.     (release-escrow gold)
  127.     (train mangonel-line)
  128. )
  129.  
  130. (defrule
  131.     (goal soldiers-available YES)
  132.     (unit-type-count-total mangonel-line < five-percent-pop)
  133.     (can-train mangonel-line)
  134.     (not (unit-available bombard-cannon) )
  135. =>
  136.     (train mangonel-line)
  137. )
  138.  
  139. (defrule
  140.     (goal archer-upgrades YES)
  141.     (goal soldiers-available YES)
  142.     (difficulty <= moderate)
  143.     (unit-type-count-total mangonel-line < ten-percent-pop)
  144.     (can-train mangonel-line)
  145.     (research-completed ri-onager)
  146.     (or
  147.         (cc-players-building-type-count any-enemy watch-tower-line > 2)
  148.         (or
  149.             (cc-players-building-type-count any-enemy castle > 0)
  150.             (cc-players-building-type-count any-enemy town-center > 1)
  151.         )
  152.     )
  153.     (not (unit-available bombard-cannon) )
  154. =>
  155.     (train mangonel-line)
  156. )
  157.  
  158. (defrule
  159.     (goal soldiers-available YES)
  160.     (unit-type-count-total mangonel-line < ten-percent-pop)
  161.     (can-train siege-onager)
  162. =>
  163.     (train siege-onager)
  164. )
  165.  
  166. (defrule
  167.     (civ-selected korean)
  168.     (goal soldiers-available YES)
  169.     (unit-type-count-total mangonel-line < fifteen-percent-pop)
  170.     (can-train mangonel-line)
  171. =>
  172.     (train mangonel-line)
  173. )
  174.  
  175. ;****************************************
  176. ;RAMS
  177. (defrule
  178.     (goal siege-available NO)
  179.     (can-train-with-escrow battering-ram-line)
  180.     (or
  181.         (unit-type-count militiaman-line > 0)
  182.         (unit-type-count spearman-line > 0)
  183.     )
  184.     (nor
  185.         (can-train battering-ram-line)
  186.         (or
  187.             (goal upgrade-conflict NOTICE)
  188.             (town-under-attack)
  189.         )
  190.     )
  191. =>
  192.     (release-escrow wood)
  193.     (release-escrow gold)
  194.     (train battering-ram-line)
  195. )
  196.  
  197. (defrule
  198.     (goal soldiers-available YES)
  199.     (unit-type-count-total battering-ram-line < five-percent-pop)
  200.     (can-train battering-ram-line)
  201.     (or
  202.         (unit-type-count militiaman-line > 0)
  203.         (unit-type-count spearman-line > 0)
  204.     )
  205.     (nor
  206.         (unit-available bombard-cannon)
  207.         (town-under-attack)
  208.     )
  209. =>
  210.     (train battering-ram-line)
  211. )
  212.  
  213. (defrule
  214.     (goal soldiers-available YES)
  215.     (unit-type-count-total battering-ram-line < ten-percent-pop)
  216.     (cc-players-building-type-count any-enemy bombard-tower == 0)
  217.     (research-completed ri-capped-ram)
  218.     (can-train battering-ram)
  219.     (or
  220.         (cc-players-building-type-count any-enemy castle > 0)
  221.         (or
  222.             (cc-players-building-type-count any-enemy town-center > 1)
  223.             (cc-players-building-type-count any-enemy watch-tower-line > 2)
  224.         )
  225.     )
  226.     (nor
  227.         (unit-available bombard-cannon)
  228.         (town-under-attack)
  229.     )
  230. =>
  231.     (train battering-ram)
  232. )
  233.  
  234. (defrule
  235.     (goal soldiers-available YES)
  236.     (unit-type-count-total battering-ram-line < ten-percent-pop)
  237.     (can-train siege-ram)
  238.     (or
  239.         (unit-type-count militiaman-line > 0)
  240.         (unit-type-count spearman-line > 0)
  241.     )
  242.     (not (town-under-attack) )
  243. =>
  244.     (train siege-ram)
  245. )
  246.  
  247.  
  248. ;****************************************
  249. ;BOMBARD CANNONS
  250. (defrule
  251.     (goal siege-available NO)
  252.     (difficulty <= moderate)
  253.     (can-train-with-escrow bombard-cannon)
  254.     (nor
  255.         (can-train bombard-cannon)
  256.         (or
  257.             (goal upgrade-conflict NOTICE)
  258.             (town-under-attack)
  259.         )
  260.     )
  261. =>
  262.     (release-escrow wood)
  263.     (release-escrow gold)
  264.     (train bombard-cannon)
  265.     (chat-local-to-self "bombard")
  266. )
  267.  
  268. (defrule
  269.     (goal soldiers-available YES)
  270.     (difficulty <= moderate)
  271.     (unit-type-count-total bombard-cannon < five-percent-pop)
  272.     (can-train bombard-cannon)
  273.     (not (town-under-attack) )
  274. =>
  275.     (train bombard-cannon)
  276.     (chat-local-to-self "bombard")
  277. )
  278.  
  279. (defrule
  280.     (goal soldiers-available YES)
  281.     (difficulty <= hard)
  282.     (unit-type-count-total bombard-cannon < ten-percent-pop)
  283.     (can-train bombard-cannon)
  284.     (or
  285.         (soldier-count > twenty-percent-pop)
  286.         (map-type black-forest)
  287.     )
  288.     (not (town-under-attack) )
  289. =>
  290.     (train bombard-cannon)
  291.     (chat-local-to-self "bombard")
  292. )
  293.  
  294. ;***********************
  295. ;TREBUCHETS
  296. (defrule
  297.     (goal siege-available NO)
  298.     (can-train-with-escrow trebuchet)
  299.     (nor
  300.         (can-train trebuchet)
  301.         (or
  302.             (goal upgrade-conflict NOTICE)
  303.             (town-under-attack)
  304.         )
  305.     )
  306. =>
  307.     (release-escrow wood)
  308.     (release-escrow gold)
  309.     (train trebuchet)
  310. )
  311.  
  312. (defrule
  313.     (goal soldiers-available YES)
  314.     (unit-type-count-total trebuchet < 3)
  315.     (soldier-count > fifteen-percent-pop)
  316.     (can-train trebuchet)
  317.     (not (town-under-attack) )
  318. =>
  319.     (train trebuchet)
  320. )
  321.  
  322. (defrule
  323.     (goal soldiers-available YES)
  324.     (unit-type-count-total trebuchet < 3)
  325.     (can-train-with-escrow trebuchet)
  326.     (nor 
  327.         (can-train trebuchet)
  328.         (or
  329.             (goal upgrade-conflict NOTICE)
  330.             (town-under-attack)
  331.         )
  332.     )
  333.     (or
  334.         (cc-players-building-type-count any-enemy town-center > 1)
  335.         (map-type black-forest)
  336.     )
  337. =>
  338.     (release-escrow wood)
  339.     (release-escrow gold)
  340.     (train trebuchet)
  341. )
  342.  
  343. (defrule
  344.     (goal soldiers-available YES)
  345.     (unit-type-count-total trebuchet < 3)
  346.     (can-train-with-escrow trebuchet)
  347.     (nor 
  348.         (can-train trebuchet)
  349.         (or
  350.             (goal upgrade-conflict NOTICE)
  351.             (town-under-attack)
  352.         )
  353.     )
  354.     (or
  355.         (cc-players-building-type-count any-enemy castle > 0)
  356.         (cc-players-building-type-count any-enemy watch-tower-line > 3)
  357.     )
  358. =>
  359.     (release-escrow wood)
  360.     (release-escrow gold)
  361.     (train trebuchet)
  362. )
  363.  
  364. ;*********************************
  365. #load-if-not-defined DEATH-MATCH
  366.  
  367. ;build superunits
  368. (defrule
  369.     (current-age == imperial-age)
  370. =>
  371.     (disable-timer t-ageup)
  372.     (enable-timer t-ageup 30)
  373.     (disable-self)
  374. )
  375.  
  376. (defrule
  377.     (population < unit-max)
  378.     (timer-triggered t-ageup)
  379.     (can-train my-unique-unit-line)
  380. =>
  381.     (train my-unique-unit-line)
  382.     (set-goal secondary-build 0)
  383. )
  384.  
  385. (defrule
  386.     (population < unit-max)
  387.     (timer-triggered t-ageup)
  388.     (can-train champion)
  389. =>
  390.     (train champion)
  391.     (set-goal secondary-build 0)
  392. )
  393.  
  394. (defrule
  395.     (population < unit-max)
  396.     (timer-triggered t-ageup)
  397.     (can-train paladin)
  398. =>
  399.     (train paladin)
  400.     (set-goal secondary-build 0)
  401. )
  402.  
  403. (defrule
  404.     (population < unit-max)
  405.     (timer-triggered t-ageup)
  406.     (can-train heavy-cavalry-archer)
  407. =>
  408.     (train heavy-cavalry-archer)
  409.     (set-goal secondary-build 0)
  410. )
  411.  
  412. (defrule
  413.     (population < unit-max)
  414.     (timer-triggered t-ageup)
  415.     (can-train hand-cannoneer)
  416. =>
  417.     (train hand-cannoneer)
  418.     (set-goal secondary-build 0)
  419. )
  420.  
  421. (defrule
  422.     (population < unit-max)
  423.     (timer-triggered t-ageup)
  424.     (can-train arbalest)
  425.     (or
  426.         (goal secondary-build 0)
  427.         (not (unit-available hand-cannoneer) )
  428.     )
  429. =>
  430.     (train arbalest)
  431.     (set-goal secondary-build 1)
  432. )
  433.  
  434. (defrule
  435.     (current-age == imperial-age)
  436.     (timer-triggered t-ageup)
  437. =>
  438.     (disable-timer t-ageup)
  439.     (enable-timer t-ageup 30)
  440. )
  441. #end-if
  442. ;******************************************************
  443. ;train specialty units
  444. (defrule
  445.     (unit-type-count-total camel-line < 1)
  446.     (can-train camel-line)
  447.     (or
  448.         (or
  449.             (cc-players-unit-type-count any-enemy knight-line >= five-percent-pop)
  450.             (cc-players-unit-type-count any-enemy cavalry-archer-line >= five-percent-pop)
  451.         )
  452.         (or
  453.             (cc-players-unit-type-count any-enemy light-cavalry >= five-percent-pop)
  454.             (cc-players-unit-type-count any-enemy camel-line >= five-percent-pop)
  455.         )
  456.     )
  457.     (or
  458.         (goal siege-available YES)
  459.         (town-under-attack)
  460.     )
  461. =>
  462.     (train camel-line)
  463. )
  464.  
  465. (defrule
  466.     (unit-type-count-total camel-line < 1)
  467.     (can-train camel-line)
  468.     (or
  469.         (or
  470.             (cc-players-unit-type-count any-enemy cataphract-line >= five-percent-pop)
  471.             (cc-players-unit-type-count any-enemy war-elephant-line >= five-percent-pop)
  472.         )
  473.         (or
  474.             (cc-players-unit-type-count any-enemy mameluke-line >= five-percent-pop)
  475.             (cc-players-unit-type-count any-enemy mangudai-line >= five-percent-pop)
  476.         )
  477.     )
  478.     (or
  479.         (goal siege-available YES)
  480.         (town-under-attack)
  481.     )
  482. =>
  483.     (train camel-line)
  484. )
  485.  
  486. (defrule
  487.     (unit-type-count-total camel-line < 1)
  488.     (can-train camel-line)
  489.     (or
  490.         (or
  491.             (cc-players-unit-type-count any-enemy tarkan-line >= five-percent-pop)
  492.             (cc-players-unit-type-count any-enemy war-wagon-line >= five-percent-pop)
  493.         )
  494.         (cc-players-unit-type-count any-enemy conquistador-line >= five-percent-pop)
  495.     )
  496.     (or
  497.         (goal siege-available YES)
  498.         (town-under-attack)
  499.     )
  500. =>
  501.     (train camel-line)
  502. )
  503.  
  504. (defrule
  505.     (unit-type-count-total camel-line < five-percent-pop)
  506.     (can-train camel-line)
  507.     (or
  508.         (or
  509.             (cc-players-unit-type-count any-enemy knight-line >= ten-percent-pop)
  510.             (cc-players-unit-type-count any-enemy cavalry-archer-line >= ten-percent-pop)
  511.         )
  512.         (or
  513.             (cc-players-unit-type-count any-enemy light-cavalry >= ten-percent-pop)
  514.             (cc-players-unit-type-count any-enemy camel-line >= ten-percent-pop)
  515.         )
  516.     )
  517.     (or
  518.         (goal siege-available YES)
  519.         (town-under-attack)
  520.     )
  521. =>
  522.     (train camel-line)
  523. )
  524.  
  525. (defrule
  526.     (unit-type-count-total camel-line < five-percent-pop)
  527.     (can-train camel-line)
  528.     (or
  529.         (or
  530.             (cc-players-unit-type-count any-enemy cataphract-line >= ten-percent-pop)
  531.             (cc-players-unit-type-count any-enemy war-elephant-line >= ten-percent-pop)
  532.         )
  533.         (or
  534.             (cc-players-unit-type-count any-enemy mameluke-line >= ten-percent-pop)
  535.             (cc-players-unit-type-count any-enemy mangudai-line >= ten-percent-pop)
  536.         )
  537.     )
  538.     (or
  539.         (goal siege-available YES)
  540.         (town-under-attack)
  541.     )
  542. =>
  543.     (train camel-line)
  544. )
  545.  
  546. (defrule
  547.     (unit-type-count-total camel-line < five-percent-pop)
  548.     (can-train camel-line)
  549.     (or
  550.         (or
  551.             (cc-players-unit-type-count any-enemy tarkan-line >= ten-percent-pop)
  552.             (cc-players-unit-type-count any-enemy war-wagon-line >= ten-percent-pop)
  553.         )
  554.         (cc-players-unit-type-count any-enemy conquistador-line >= ten-percent-pop)
  555.     )
  556.     (or
  557.         (goal siege-available YES)
  558.         (town-under-attack)
  559.     )
  560. =>
  561.     (train camel-line)
  562. )
  563.  
  564. (defrule
  565.     (unit-type-count-total spearman-line < 3)
  566.     (can-train spearman-line)
  567.     (or
  568.         (or
  569.             (cc-players-unit-type-count any-enemy knight-line >= five-percent-pop)
  570.             (cc-players-unit-type-count any-enemy cavalry-archer-line >= five-percent-pop)
  571.         )
  572.         (or
  573.             (cc-players-unit-type-count any-enemy light-cavalry >= five-percent-pop)
  574.             (cc-players-unit-type-count any-enemy camel-line >= five-percent-pop)
  575.         )
  576.     )
  577.     (or
  578.         (goal siege-available YES)
  579.         (town-under-attack)
  580.     )
  581. =>
  582.     (train spearman-line)
  583. )
  584.  
  585. (defrule
  586.     (unit-type-count-total spearman-line < 3)
  587.     (can-train spearman-line)
  588.     (or
  589.         (or
  590.             (cc-players-unit-type-count any-enemy cataphract-line >= five-percent-pop)
  591.             (cc-players-unit-type-count any-enemy war-elephant-line >= five-percent-pop)
  592.         )
  593.         (or
  594.             (cc-players-unit-type-count any-enemy mameluke-line >= five-percent-pop)
  595.             (cc-players-unit-type-count any-enemy mangudai-line >= five-percent-pop)
  596.         )
  597.     )
  598.     (or
  599.         (goal siege-available YES)
  600.         (town-under-attack)
  601.     )
  602. =>
  603.     (train spearman-line)
  604. )
  605.  
  606. (defrule
  607.     (unit-type-count-total spearman-line < 3)
  608.     (can-train spearman-line)
  609.     (or
  610.         (or
  611.             (cc-players-unit-type-count any-enemy tarkan-line >= five-percent-pop)
  612.             (cc-players-unit-type-count any-enemy war-wagon-line >= five-percent-pop)
  613.         )
  614.         (cc-players-unit-type-count any-enemy conquistador-line >= five-percent-pop)
  615.     )
  616.     (or
  617.         (goal siege-available YES)
  618.         (town-under-attack)
  619.     )
  620. =>
  621.     (train spearman-line)
  622. )
  623.  
  624. (defrule
  625.     (unit-type-count-total spearman-line < five-percent-pop)
  626.     (can-train spearman-line)
  627.     (or
  628.         (or
  629.             (cc-players-unit-type-count any-enemy knight-line >= ten-percent-pop)
  630.             (cc-players-unit-type-count any-enemy cavalry-archer-line >= ten-percent-pop)
  631.         )
  632.         (or
  633.             (cc-players-unit-type-count any-enemy light-cavalry >= ten-percent-pop)
  634.             (cc-players-unit-type-count any-enemy camel-line >= ten-percent-pop)
  635.         )
  636.     )
  637.     (or
  638.         (goal siege-available YES)
  639.         (town-under-attack)
  640.     )
  641. =>
  642.     (train spearman-line)
  643. )
  644.  
  645. (defrule
  646.     (unit-type-count-total spearman-line < five-percent-pop)
  647.     (can-train spearman-line)
  648.     (or
  649.         (or
  650.             (cc-players-unit-type-count any-enemy cataphract-line >= ten-percent-pop)
  651.             (cc-players-unit-type-count any-enemy war-elephant-line >= ten-percent-pop)
  652.         )
  653.         (or
  654.             (cc-players-unit-type-count any-enemy mameluke-line >= ten-percent-pop)
  655.             (cc-players-unit-type-count any-enemy mangudai-line >= ten-percent-pop)
  656.         )
  657.     )
  658.     (or
  659.         (goal siege-available YES)
  660.         (town-under-attack)
  661.     )
  662. =>
  663.     (train spearman-line)
  664. )
  665.  
  666. (defrule
  667.     (unit-type-count-total spearman-line < five-percent-pop)
  668.     (can-train spearman-line)
  669.     (or
  670.         (or
  671.             (cc-players-unit-type-count any-enemy tarkan-line >= ten-percent-pop)
  672.             (cc-players-unit-type-count any-enemy war-wagon-line >= ten-percent-pop)
  673.         )
  674.         (cc-players-unit-type-count any-enemy conquistador-line >= ten-percent-pop)
  675.     )
  676.     (or
  677.         (goal siege-available YES)
  678.         (town-under-attack)
  679.     )
  680. =>
  681.     (train spearman-line)
  682. )
  683.  
  684. (defrule
  685.     (unit-type-count-total skirmisher-line < 3)
  686.     (can-train skirmisher-line)
  687.     (or
  688.         (or
  689.             (cc-players-unit-type-count any-enemy archer-line >= five-percent-pop)
  690.             (cc-players-unit-type-count any-enemy cavalry-archer-line >= five-percent-pop)
  691.         )
  692.         (or
  693.             (cc-players-unit-type-count any-enemy skirmisher-line >= five-percent-pop)
  694.             (cc-players-unit-type-count any-enemy hand-cannoneer >= five-percent-pop)
  695.         )
  696.     )
  697.     (or
  698.         (goal siege-available YES)
  699.         (town-under-attack)
  700.     )
  701. =>
  702.     (train skirmisher-line)
  703. )
  704.  
  705. (defrule
  706.     (unit-type-count-total skirmisher-line < 3)
  707.     (can-train skirmisher-line)
  708.     (or
  709.         (or
  710.             (cc-players-unit-type-count any-enemy longbowman-line >= five-percent-pop)
  711.             (cc-players-unit-type-count any-enemy chu-ko-nu-line >= five-percent-pop)
  712.         )
  713.         (or
  714.             (cc-players-unit-type-count any-enemy mangudai-line >= five-percent-pop)
  715.             (cc-players-unit-type-count any-enemy janissary-line >= five-percent-pop)
  716.         )
  717.     )
  718.     (or
  719.         (goal siege-available YES)
  720.         (town-under-attack)
  721.     )
  722. =>
  723.     (train skirmisher-line)
  724. )
  725.  
  726. (defrule
  727.     (unit-type-count-total skirmisher-line < 3)
  728.     (can-train skirmisher-line)
  729.     (or
  730.         (or
  731.             (cc-players-unit-type-count any-enemy plumed-archer-line >= five-percent-pop)
  732.             (cc-players-unit-type-count any-enemy war-wagon-line >= five-percent-pop)
  733.         )
  734.         (cc-players-unit-type-count any-enemy conquistador-line >= five-percent-pop)
  735.     )
  736.     (or
  737.         (goal siege-available YES)
  738.         (town-under-attack)
  739.     )
  740. =>
  741.     (train skirmisher-line)
  742. )
  743.  
  744. (defrule
  745.     (unit-type-count-total skirmisher-line < five-percent-pop)
  746.     (can-train skirmisher-line)
  747.     (or
  748.         (or
  749.             (cc-players-unit-type-count any-enemy archer-line >= ten-percent-pop)
  750.             (cc-players-unit-type-count any-enemy cavalry-archer-line >= ten-percent-pop)
  751.         )
  752.         (or
  753.             (cc-players-unit-type-count any-enemy skirmisher-line >= ten-percent-pop)
  754.             (cc-players-unit-type-count any-enemy hand-cannoneer >= ten-percent-pop)
  755.         )
  756.     )
  757.     (or
  758.         (goal siege-available YES)
  759.         (town-under-attack)
  760.     )
  761. =>
  762.     (train skirmisher-line)
  763. )
  764.  
  765. (defrule
  766.     (unit-type-count-total skirmisher-line < five-percent-pop)
  767.     (can-train skirmisher-line)
  768.     (or
  769.         (or
  770.             (cc-players-unit-type-count any-enemy longbowman-line >= ten-percent-pop)
  771.             (cc-players-unit-type-count any-enemy chu-ko-nu-line >= ten-percent-pop)
  772.         )
  773.         (or
  774.             (cc-players-unit-type-count any-enemy mangudai-line >= ten-percent-pop)
  775.             (cc-players-unit-type-count any-enemy janissary-line >= ten-percent-pop)
  776.         )
  777.     )
  778.     (or
  779.         (goal siege-available YES)
  780.         (town-under-attack)
  781.     )
  782. =>
  783.     (train skirmisher-line)
  784. )
  785.  
  786. (defrule
  787.     (unit-type-count-total skirmisher-line < five-percent-pop)
  788.     (can-train skirmisher-line)
  789.     (or
  790.         (or
  791.             (cc-players-unit-type-count any-enemy plumed-archer-line >= ten-percent-pop)
  792.             (cc-players-unit-type-count any-enemy conquistador-line >= ten-percent-pop)
  793.         )
  794.         (cc-players-unit-type-count any-enemy war-wagon-line >= ten-percent-pop)
  795.     )
  796.     (or
  797.         (goal siege-available YES)
  798.         (town-under-attack)
  799.     )
  800. =>
  801.     (train skirmisher-line)
  802. )
  803.  
  804. (defrule
  805.     (unit-type-count-total scout-cavalry-line < 1)
  806.     (can-train scout-cavalry-line)
  807.     (or
  808.         (or
  809.             (cc-players-unit-type-count any-enemy archer-line >= five-percent-pop)
  810.             (cc-players-unit-type-count any-enemy cavalry-archer-line >= five-percent-pop)
  811.         )
  812.         (or
  813.             (cc-players-unit-type-count any-enemy skirmisher-line >= five-percent-pop)
  814.             (cc-players-unit-type-count any-enemy monk >= five-percent-pop)
  815.         )
  816.     )
  817.     (or
  818.         (goal siege-available YES)
  819.         (town-under-attack)
  820.     )
  821. =>
  822.     (train scout-cavalry-line)
  823. )
  824.  
  825. (defrule
  826.     (unit-type-count-total eagle-warrior-line < 1)
  827.     (can-train eagle-warrior-line)
  828.     (or
  829.         (or
  830.             (cc-players-unit-type-count any-enemy archer-line >= five-percent-pop)
  831.             (cc-players-unit-type-count any-enemy cavalry-archer-line >= five-percent-pop)
  832.         )
  833.         (or
  834.             (cc-players-unit-type-count any-enemy skirmisher-line >= five-percent-pop)
  835.             (cc-players-unit-type-count any-enemy monk >= five-percent-pop)
  836.         )
  837.     )
  838.     (or
  839.         (goal siege-available YES)
  840.         (town-under-attack)
  841.     )
  842. =>
  843.     (train eagle-warrior-line)
  844. )
  845.  
  846. (defrule
  847.     (unit-type-count-total scout-cavalry-line <= five-percent-pop)
  848.     (can-train scout-cavalry-line)
  849.     (or
  850.         (or
  851.             (cc-players-unit-type-count any-enemy archer-line >= ten-percent-pop)
  852.             (cc-players-unit-type-count any-enemy cavalry-archer-line >= ten-percent-pop)
  853.         )
  854.         (or
  855.             (cc-players-unit-type-count any-enemy skirmisher-line >= ten-percent-pop)
  856.             (cc-players-unit-type-count any-enemy monk >= ten-percent-pop)
  857.         )
  858.     )
  859.     (or
  860.         (goal siege-available YES)
  861.         (town-under-attack)
  862.     )
  863. =>
  864.     (train scout-cavalry-line)
  865. )
  866.  
  867. (defrule
  868.     (unit-type-count-total scout-cavalry-line < five-percent-pop)
  869.     (can-train scout-cavalry-line)
  870.     (or
  871.         (or
  872.             (cc-players-unit-type-count any-enemy longbowman-line >= ten-percent-pop)
  873.             (cc-players-unit-type-count any-enemy chu-ko-nu-line >= ten-percent-pop)
  874.         )
  875.         (or
  876.             (cc-players-unit-type-count any-enemy mangudai-line >= ten-percent-pop)
  877.             (cc-players-unit-type-count any-enemy janissary-line >= ten-percent-pop)
  878.         )
  879.     )
  880.     (or
  881.         (goal siege-available YES)
  882.         (town-under-attack)
  883.     )
  884. =>
  885.     (train scout-cavalry-line)
  886. )
  887.  
  888. (defrule
  889.     (unit-type-count-total scout-cavalry-line < five-percent-pop)
  890.     (can-train scout-cavalry-line)
  891.     (or
  892.         (or
  893.             (cc-players-unit-type-count any-enemy plumed-archer-line >= ten-percent-pop)
  894.             (cc-players-unit-type-count any-enemy conquistador-line >= ten-percent-pop)
  895.         )
  896.         (cc-players-unit-type-count any-enemy war-wagon-line >= ten-percent-pop)
  897.     )
  898.     (or
  899.         (goal siege-available YES)
  900.         (town-under-attack)
  901.     )
  902. =>
  903.     (train scout-cavalry-line)
  904. )
  905.  
  906. (defrule
  907.     (unit-type-count-total scout-cavalry-line <= five-percent-pop)
  908.     (can-train scout-cavalry-line)
  909.     (or
  910.         (or
  911.             (cc-players-unit-type-count any-enemy mangonel-line >= five-percent-pop)
  912.             (cc-players-unit-type-count any-enemy scorpion-line >= five-percent-pop)
  913.         )
  914.         (cc-players-unit-type-count any-enemy trebuchet >= 3)
  915.     )
  916.     (or
  917.         (goal siege-available YES)
  918.         (town-under-attack)
  919.     )
  920. =>
  921.     (train scout-cavalry-line)
  922. )
  923.  
  924. (defrule
  925.     (unit-type-count-total eagle-warrior-line <= five-percent-pop)
  926.     (can-train eagle-warrior-line)
  927.     (or
  928.         (or
  929.             (cc-players-unit-type-count any-enemy archer-line >= ten-percent-pop)
  930.             (cc-players-unit-type-count any-enemy cavalry-archer-line >= ten-percent-pop)
  931.         )
  932.         (or
  933.             (cc-players-unit-type-count any-enemy skirmisher-line >= ten-percent-pop)
  934.             (cc-players-unit-type-count any-enemy monk >= ten-percent-pop)
  935.         )
  936.     )
  937.     (or
  938.         (goal siege-available YES)
  939.         (town-under-attack)
  940.     )
  941. =>
  942.     (train eagle-warrior-line)
  943. )
  944.  
  945. (defrule
  946.     (unit-type-count-total eagle-warrior-line < five-percent-pop)
  947.     (can-train eagle-warrior-line)
  948.     (or
  949.         (or
  950.             (cc-players-unit-type-count any-enemy longbowman-line >= ten-percent-pop)
  951.             (cc-players-unit-type-count any-enemy chu-ko-nu-line >= ten-percent-pop)
  952.         )
  953.         (or
  954.             (cc-players-unit-type-count any-enemy mangudai-line >= ten-percent-pop)
  955.             (cc-players-unit-type-count any-enemy janissary-line >= ten-percent-pop)
  956.         )
  957.     )
  958.     (or
  959.         (goal siege-available YES)
  960.         (town-under-attack)
  961.     )
  962. =>
  963.     (train eagle-warrior-line)
  964. )
  965.  
  966. (defrule
  967.     (unit-type-count-total eagle-warrior-line < five-percent-pop)
  968.     (can-train eagle-warrior-line)
  969.     (or
  970.         (or
  971.             (cc-players-unit-type-count any-enemy plumed-archer-line >= ten-percent-pop)
  972.             (cc-players-unit-type-count any-enemy conquistador-line >= ten-percent-pop)
  973.         )
  974.         (cc-players-unit-type-count any-enemy war-wagon-line >= ten-percent-pop)
  975.     )
  976.     (or
  977.         (goal siege-available YES)
  978.         (town-under-attack)
  979.     )
  980. =>
  981.     (train eagle-warrior-line)
  982. )
  983.  
  984. (defrule
  985.     (unit-type-count-total eagle-warrior-line <= five-percent-pop)
  986.     (can-train eagle-warrior-line)
  987.     (or
  988.         (or
  989.             (cc-players-unit-type-count any-enemy mangonel-line >= five-percent-pop)
  990.             (cc-players-unit-type-count any-enemy scorpion-line >= five-percent-pop)
  991.         )
  992.         (cc-players-unit-type-count any-enemy trebuchet >= 3)
  993.     )
  994.     (or
  995.         (goal siege-available YES)
  996.         (town-under-attack)
  997.     )
  998. =>
  999.     (train eagle-warrior-line)
  1000. )
  1001.  
  1002. ;**********************************
  1003. ;monks
  1004. ;decide who is to be the monk-builder par excellence. 
  1005.  
  1006. (defrule
  1007.     (goal monk-rating GOOD)
  1008.     (difficulty <= moderate)
  1009.     (taunt-detected any-ally 230)
  1010. =>
  1011.     (set-goal monk-rating FAIR)
  1012.     (acknowledge-taunt this-any-ally 230)
  1013.     (disable-self)
  1014. )
  1015.  
  1016. (defrule
  1017.     (taunt-detected any-ally 230)
  1018.     (difficulty <= moderate)
  1019.     (or
  1020.         (goal monk-rating FAIR)
  1021.         (goal monk-rating POOR)
  1022.     )
  1023. =>
  1024.     (set-goal monk-rating NO)
  1025.     (acknowledge-taunt this-any-ally 230)
  1026.     (disable-self)
  1027. )
  1028.  
  1029. (defrule
  1030.     (goal monk-rating GOOD)
  1031.     (difficulty <= moderate)
  1032.     (game-time >= 600)
  1033.     (player-computer any-ally)
  1034. =>
  1035.     (chat-to-player-using-id every-ally 22409)    ;230
  1036.     (disable-self)
  1037. )
  1038.  
  1039. (defrule
  1040.     (goal monk-rating FAIR)
  1041.     (difficulty <= moderate)
  1042.     (game-time >= 700)
  1043.     (player-computer any-ally)
  1044. =>
  1045.     (set-goal monk-rating GOOD)
  1046.     (chat-to-player-using-id every-ally 22409)    ;230
  1047.     (disable-self)
  1048. )
  1049.  
  1050. (defrule
  1051.     (goal siege-available YES)
  1052.     (soldier-count >= five-percent-pop)
  1053.     (unit-type-count-total monk < 1)
  1054.     (can-train monk)
  1055.     (not (goal monk-rating NO) )
  1056. =>
  1057.     (train monk)
  1058. )
  1059.  
  1060. ;make a few monks 
  1061. (defrule
  1062.     (goal siege-available YES)
  1063.     (soldier-count > ten-percent-pop)
  1064.     (difficulty <= moderate)
  1065.     (unit-type-count-total monk < five-percent-pop)
  1066.     (or
  1067.         (goal monk-rating GOOD)
  1068.         (and
  1069.             (goal monk-rating FAIR)
  1070.             (gold-amount >= 300)
  1071.         )
  1072.     )
  1073.     (not (civ-selected spanish) )
  1074.     (can-train monk)
  1075. =>
  1076.     (train monk)
  1077. )
  1078.  
  1079. ;make more monks
  1080. (defrule
  1081.     (goal siege-available YES)
  1082.     (soldier-count > ten-percent-pop)
  1083.     (current-age == imperial-age)
  1084.     (difficulty <= moderate)
  1085.     (unit-type-count-total monk < ten-percent-pop)
  1086.     (or
  1087.         (goal monk-rating GOOD)
  1088.         (and
  1089.             (goal monk-rating FAIR)
  1090.             (gold-amount >= 300)
  1091.         )
  1092.     )
  1093.     (not (civ-selected spanish) )
  1094.     (can-train monk)
  1095. =>
  1096.     (train monk)
  1097. )
  1098.  
  1099. ;if we have lots of gold, build monks sans restraint
  1100. (defrule
  1101.     (goal siege-available YES)
  1102.     (goal monk-rating GOOD)
  1103.     (difficulty <= moderate)
  1104.     (soldier-count > ten-percent-pop)
  1105.     (gold-amount >= 300)
  1106.     (unit-type-count-total monk < fifteen-percent-pop)
  1107.     (not (civ-selected spanish) )
  1108.     (can-train monk)
  1109. =>
  1110.     (train monk)
  1111. )
  1112.  
  1113. #load-if-defined SPANISH-CIV
  1114. ;make missionaries if we're spanish
  1115. (defrule
  1116.     (goal siege-available YES)
  1117.     (soldier-count > ten-percent-pop)
  1118.     (difficulty <= moderate)
  1119.     (unit-type-count-total missionary < five-percent-pop)
  1120.     (or
  1121.         (goal monk-rating GOOD)
  1122.         (and
  1123.             (goal monk-rating FAIR)
  1124.             (gold-amount >= 300)
  1125.         )
  1126.     )
  1127.     (can-train missionary)
  1128. =>
  1129.     (train missionary)
  1130. )
  1131.  
  1132. (defrule
  1133.     (goal siege-available YES)
  1134.     (soldier-count > ten-percent-pop)
  1135.     (current-age == imperial-age)
  1136.     (difficulty <= moderate)
  1137.     (unit-type-count-total missionary < ten-percent-pop)
  1138.     (or
  1139.         (goal monk-rating GOOD)
  1140.         (and
  1141.             (goal monk-rating FAIR)
  1142.             (gold-amount >= 300)
  1143.         )
  1144.     )
  1145.     (can-train missionary)
  1146. =>
  1147.     (train missionary)
  1148. )
  1149.  
  1150. ;if we have lots of gold, build monks sans restraint
  1151. (defrule
  1152.     (goal siege-available YES)
  1153.     (goal monk-rating GOOD)
  1154.     (difficulty <= moderate)
  1155.     (soldier-count > ten-percent-pop)
  1156.     (gold-amount >= 300)
  1157.     (unit-type-count-total missionary < fifteen-percent-pop)
  1158.     (can-train missionary)
  1159. =>
  1160.     (train missionary)
  1161. )
  1162. #end-if
  1163.  
  1164.